# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=gcrypt
pkgver=32.d3f9f06
pkgrel=1
epoch=1
pkgdesc='Simple, secure and performance file encryption tool written in C'
groups=('blackarch' 'blackarch-crypto')
arch=('x86_64' 'aarch64')
url='https://gitlab.com/GasparVardanyan/gcrypt'
license=('MIT')
depends=('glibc' 'libbsd')
makedepends=('git')
source=("git+https://gitlab.com/GasparVardanyan/gcrypt")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  gcc -o $pkgname *.c -std=c18 -pedantic -pedantic-errors -Wall -O \
    -fstack-protector-all -fPIE -fPIC \
    -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,-relro -lbsd
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

